<!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
    <title>用户信息 </title>
    <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
    <link th:href="@{/bootstrap/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/assets/css/plugins.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/plugins/table/datatable/datatables.css}" rel="stylesheet" type="text/css" >
    <link th:href="@{/plugins/table/datatable/dt-global_style.css}" rel="stylesheet" type="text/css" >

    <link th:href="@{/plugins/sweetalerts/sweetalert2.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/plugins/sweetalerts/sweetalert.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/assets/css/components/custom-sweetalert.css}" rel="stylesheet" type="text/css" />

    <link th:href="@{/plugins/notification/snackbar/snackbar.min.css}" rel="stylesheet" type="text/css" />

    <link th:href="@{/assets/css/elements/custom-pagination.css}" rel="stylesheet" type="text/css" />
    <style>
        .menu {
            height: 50px;
            line-height: 50px;
        }
        .feather-search {
            position: absolute;
            right: 0.625rem;
            top: 0.625rem;
        }

        @media screen and (max-width: 1000px) {
            .screeningAll {
                display: block;
                flex-direction: column;
                margin-bottom: 1.25rem;
            }

            .screening input {
                font-size: 0.75rem;
            }
        }
        .btn{
            font-size: 12px;
        }
    </style>
</head>

<body class="alt-menu sidebar-noneoverflow">

    <!--  BEGIN NAVBAR  -->
    <div class="header-container fixed-top">
        <header class="header navbar navbar-expand-sm expand-header">
            <a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg
                    xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                    stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                    class="feather feather-menu">
                    <line x1="3" y1="12" x2="21" y2="12"></line>
                    <line x1="3" y1="6" x2="21" y2="6"></line>
                    <line x1="3" y1="18" x2="21" y2="18"></line>
                </svg></a>

            <ul class="navbar-item flex-row ml-auto">
                <li class="nav-item dropdown user-profile-dropdown  order-lg-0 order-1">
                    <a href="javascript:void(0);" class="nav-link dropdown-toggle user" id="userProfileDropdown"
                       data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                             stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                             class="feather feather-user-check">
                            <path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                            <circle cx="8.5" cy="7" r="4"></circle>
                            <polyline points="17 11 19 13 23 9"></polyline>
                        </svg>
                    </a>
                    <div class="dropdown-menu position-absolute e-animated e-fadeInUp"
                         aria-labelledby="userProfileDropdown">
                        <div class="user-profile-section">
                            <div class="media mx-auto">
                                <img th:src="@{/assets/img/avatar.png}" class="img-fluid mr-2" alt="avatar">
                                <div class="media-body">
                                    <h5>[[${admin.username}]]</h5>
                                </div>
                            </div>
                        </div>
                        <div class="dropdown-item">
                            <a href="/admin/userinfo">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-user">
                                    <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                    <circle cx="12" cy="7" r="4"></circle>
                                </svg> <span>个人信息</span>
                            </a>
                        </div>
                        <div class="dropdown-item">
                            <a href="/admin/out">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-log-out">
                                    <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
                                    <polyline points="16 17 21 12 16 7"></polyline>
                                    <line x1="21" y1="12" x2="9" y2="12"></line>
                                </svg> <span>退出登录</span>
                            </a>
                        </div>
                    </div>
                </li>
            </ul>
        </header>
    </div>
    <!--  END NAVBAR  -->

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container sidebar-closed sbar-open" id="container">

        <div class="overlay"></div>
        <div class="cs-overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN SIDEBAR  -->
        <div class="sidebar-wrapper sidebar-theme">

            <nav id="sidebar">

                <ul class="navbar-nav theme-brand flex-row  text-center">
                </ul>

                <ul class="list-unstyled menu-categories" id="accordionExample">
                    <li class="menu" th:if="${admin.type != 3}">
                        <a href="/admin" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-home">
                                    <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                                    <polyline points="9 22 9 12 15 12 15 22"></polyline>
                                </svg>
                                <span>首页</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu" th:if="${admin.type < 2}">
                        <a href="/admin/appsContacts" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-layout">
                                    <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                    <line x1="3" y1="9" x2="21" y2="9"></line>
                                    <line x1="9" y1="21" x2="9" y2="9"></line>
                                </svg>
                                <span>团队管理</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu" th:if="${admin.type == 2}">
                        <a href="/admin/people" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-layout">
                                    <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                    <line x1="3" y1="9" x2="21" y2="9"></line>
                                    <line x1="9" y1="21" x2="9" y2="9"></line>
                                </svg>
                                <span>成员管理</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu" th:if="${admin.type < 2}">
                        <a href="/admin/activityList" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-box">
                                    <path
                                            d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z">
                                    </path>
                                    <polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
                                    <line x1="12" y1="22.08" x2="12" y2="12"></line>
                                </svg>
                                <span>活动管理</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu" th:if="${admin.type == 3}">
                        <a href="/admin/share" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-home">
                                    <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                                    <polyline points="9 22 9 12 15 12 15 22"></polyline>
                                </svg>
                                <span>首页</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu" th:if="${admin.type == 2}">
                        <a href="/admin/share" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-home">
                                    <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                                    <polyline points="9 22 9 12 15 12 15 22"></polyline>
                                </svg>
                                <span>邀请客户</span>
                            </div>
                        </a>
                    </li>

                    <li class="menu">
                        <a href="/admin/userinfo" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-user">
                                    <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
                                    <circle cx="12" cy="7" r="4"></circle>
                                </svg>
                                <span>个人信息</span>
                            </div>
                        </a>
                    </li>
                    <li class="menu active">
                        <a href="/admin/personInfo" aria-expanded="true" class="dropdown-toggle">
                            <div class="">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                     fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                     stroke-linejoin="round" class="feather feather-users">
                                    <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                                    <circle cx="9" cy="7" r="4"></circle>
                                    <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
                                    <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
                                </svg>
                                <span>客户信息</span>
                            </div>
                        </a>
                    </li>
                </ul>

            </nav>

        </div>
        <!--  END SIDEBAR  -->

        <!--  BEGIN CONTENT AREA  -->
        <div id="content" class="main-content">
            <div class="layout-px-spacing">

                <div class="page-header">
                    <div class="page-title">
                        <h3 >客户信息</h3>
                    </div>
                </div>

                <div class="row" id="cancel-row">

                    <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                        <div class="widget-content widget-content-area br-6">
                            <div class="table-responsive mb-4 mt-4">




                                <div class="screeningAll" style="display: flex; justify-content: space-between;">
                                    <div class="screening">



                                        <div class="btn-group mb-4 mr-2" role="group" th:if="${admin.type ==0||admin.type ==1}">

                                            <span style="text-align:center;line-height:2.5625rem;">团队：</span>
                                            <button id="collection" type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown"
                                                    aria-haspopup="true" aria-expanded="false">全部
                                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                                                     stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                     class="feather feather-chevron-down">
                                                    <polyline points="6 9 12 15 18 9"></polyline>
                                                </svg>
                                                </button>

                                            <div class="dropdown-menu" aria-labelledby="btndefault">
                                                <a href="javascript:void(0);" class="dropdown-item" onclick="selecGroup(0)"><i class="flaticon-home-fill-1 mr-1"></i>全部</a>
                                                <a th:each="group:${group}"  th:id="'group_'+${group.id}" th:data-groupname="${group.groupName}" href="javascript:void(0);" class="dropdown-item" th:onclick="selecGroup([[${group.id}]])" ><i class="flaticon-home-fill-1 mr-1"></i>[[${group.groupName}]]</a>
                                            </div>


                                        </div>

                                        <div class="btn-group mb-4 mr-2" role="group" th:if="${admin.type ==2}">

                                            <span style="text-align:center;line-height:2.5625rem;">成员：</span>
                                            <button id="people" type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown"
                                                    aria-haspopup="true" aria-expanded="false">全部
                                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                                                     stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                     class="feather feather-chevron-down">
                                                    <polyline points="6 9 12 15 18 9"></polyline>
                                                </svg>
                                            </button>

                                            <div class="dropdown-menu" aria-labelledby="btndefault" id="groupList">
                                                <a href="javascript:void(0);" class="dropdown-item" onclick="selecPeople(0)"><i class="flaticon-home-fill-1 mr-1"></i>全部</a>
                                                <a th:each="group:${people}"  th:id="'group_'+${group.id}" th:data-groupname="${group.username}" href="javascript:void(0);" class="dropdown-item" th:onclick="selecPeople([[${group.id}]])" ><i class="flaticon-home-fill-1 mr-1"></i>[[${group.username}]]</a>
                                            </div>


                                        </div>




                                        <div class="btn-group mb-4 mr-2" role="group">
                                            <span style="text-align:center;line-height:2.5625rem;">领取方式：</span>
                                            <button id="mail" type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown"
                                                    aria-haspopup="true" aria-expanded="false">全部
                                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                                                     stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                     class="feather feather-chevron-down">
                                                    <polyline points="6 9 12 15 18 9"></polyline>
                                                </svg></button>
                                            <div class="dropdown-menu" aria-labelledby="btndefault">
                                                <a href="javascript:void(0);" class="dropdown-item" onclick="mail(this)"><i
                                                        class="flaticon-home-fill-1 mr-1"></i>全部</a>
                                                <a href="javascript:void(0);" class="dropdown-item" onclick="mail(this)"><i
                                                        class="flaticon-home-fill-1 mr-1"></i>快递</a>
                                                <a href="javascript:void(0);" class="dropdown-item" onclick="mail(this)"><i
                                                        class="flaticon-gear-fill mr-1"></i>自取</a>
                                            </div>
                                        </div>
                                    </div>



                                    <div class="screening">
                                        <div class="w-100" style="display: flex; position: relative; float: right;">
                                            <input type="text" class="w-100 form-control product-search br-30" id="input-search"
                                                   style="position: relative;" placeholder="请输入搜索内容">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                                                 stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                 class="feather feather-search" onclick="search()">
                                                <circle cx="11" cy="11" r="8"></circle>
                                                <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                                            </svg></input>
                                        </div>
                                    </div>
                                </div>



                                <table id="zero-config" class="table table-hover" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>客户姓名</th>
                                            <th>客户联系</th>
                                            <th>客户地址</th>
                                            <th>领取方式</th>
                                            <th>提交时间</th>
                                            <th>推荐人账号</th>
                                            <th>推荐人姓名</th>
                                            <th class="no-content"></th>
                                        </tr>
                                    </thead>
                                    <tbody id="dataList">
                                    </tbody>
                                </table>


                            </div>
                        </div>
                    </div>

                </div>

            </div>
        </div>
        <!--  END CONTENT AREA  -->
    </div>
    <!-- END MAIN CONTAINER -->



    <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
    <script th:src="@{/assets/js/libs/jquery-3.1.1.min.js}"></script>
    <script th:src="@{/bootstrap/js/popper.min.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
    <script th:src="@{/plugins/perfect-scrollbar/perfect-scrollbar.min.js}"></script>
    <script th:src="@{/assets/js/app.js}"></script>
    <script th:src="@{/assets/js/custom.js}"></script>
    <script th:src="@{/plugins/table/datatable/datatables.js}"></script>

    <!-- BEGIN THEME GLOBAL STYLE -->
    <script th:src="@{/assets/js/scrollspyNav.js}"></script>
    <script th:src="@{/plugins/sweetalerts/sweetalert2.min.js}"></script>
    <script th:src="@{/plugins/sweetalerts/custom-sweetalert.js}"></script>
    <script th:src="@{/plugins/notification/snackbar/snackbar.min.js}"></script>
    <!-- END THEME GLOBAL STYLE -->
    <script>
        $(document).ready(function () {
            App.init();
        });
        var data = {
            group:0,
            id:0,
            mail:'',
            key:''
        }
        $.ajax({
            type: "GET",//方法类型
            url: "/admin/getPersonInfo" ,//url
            success: function (result) {
                if(result.code == 1){
                    console.log(result.msg)
                    var data = result.msg;
                    var html = "";
                    for (var i=0;i<data.length;i++){
                        html+= `<tr class="tr">
                                            <td>${data[i].username}</td>
                                            <td>${data[i].phone}</td>
                                            <td>`+data[i].province+`-`+data[i].city+`-`+data[i].county+`-`+data[i].address+`</td>
                                            <td>${data[i].isMail}</td>
                                            <td>`+formatterTime(data[i].createTime.time ,"yyyy-MM-dd hh:mm:ss")+`</td>
                                            <td>${data[i].account}</td>
                                            <td>${data[i].accountname}</td>
                                            <td><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                                    viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                                    stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                    class="feather feather-x-circle" onclick="del(${data[i].id})">
                                                    <circle cx="12" cy="12" r="10"></circle>
                                                    <line x1="15" y1="9" x2="9" y2="15"></line>
                                                    <line x1="9" y1="9" x2="15" y2="15"></line>
                                                </svg></td>
                                        </tr>`
                    }
                    $("#dataList").html(html);
                }
            },
            error : function() {
                Snackbar.show({
                    text: '请稍后再试',
                    pos: 'top-center'
                });
            }
        });

        function getLocalTime(nS) {
            return new Date(parseInt(nS.time) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
        }
        function format(shijianchuo)
        {
            var time = new Date(shijianchuo);
            var y = time.getFullYear();
            var m = time.getMonth()+1;
            var d = time.getDate();
            var h = time.getHours();
            var mm = time.getMinutes();
            var s = time.getSeconds();
            return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
        }
    </script>
    <script>


        function selecGroup (i) {
            if(i ==0){
                $("#collection").html("全部"+jt);
            }else{
                var n = $("#group_"+i).data('groupname');
                $("#collection").html(n+jt);
            }
            data.group = i;
            sec(data);
        }

        function selecPeople (i) {
            if(i ==0){
                $("#people").html("全部"+jt);
            }else{
                var n = $("#group_"+i).data('groupname');
                $("#people").html(n+jt);
            }
            data.id = i;
            sec(data);
        }


        // 领取方式
        function mail(obj) {
            $('#mail').html($(obj).text() + jt)
            data.mail = $(obj).text();
            sec(data);
        }

        function search() {
            var key = $("#input-search").val();
            data.key = key;
            sec(data);
            $("#input-search").val("");
        }

        function sec(data) {
            $.ajax({
                type: "GET",//方法类型
                url: "/admin/getPersonInfo" ,
                data: data,
                success: function (result) {
                    if(result.code == 1){
                        var data = result.msg;
                        var html = "";
                        for (var i=0;i<data.length;i++){
                            html+= `<tr class="tr">
                                            <td>${data[i].username}</td>
                                            <td>${data[i].phone}</td>
                                            <td>`+data[i].province+`-`+data[i].city+`-`+data[i].county+`-`+data[i].address+`</td>
                                            <td>${data[i].isMail}</td>
                                            <td>`+formatterTime(data[i].createTime.time ,"yyyy-MM-dd hh:mm:ss")+`</td>
                                            <td>${data[i].account}</td>
                                            <td>${data[i].accountname}</td>
                                            <td><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                                    viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                                    stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                    class="feather feather-x-circle" onclick="del(${data[i].id})">
                                                    <circle cx="12" cy="12" r="10"></circle>
                                                    <line x1="15" y1="9" x2="9" y2="15"></line>
                                                    <line x1="9" y1="9" x2="15" y2="15"></line>
                                                </svg></td>
                                        </tr>`
                        }
                        $("#dataList").html(html);
                    }
                },
                error : function() {
                    Snackbar.show({
                        text: '请稍后再试',
                        pos: 'top-center'
                    });
                }
            });

        }

        function del(i) {
            swal({
                title: '确定删除吗?',
                text: "删除后不能恢复！",
                type: 'warning',
                showCancelButton: true,
                cancelButtonText:
                    '<i class="flaticon-cancel-circle"></i> 取消',
                confirmButtonText: '确定',
                padding: '2em'
            }).then(function(result) {
                if (result.value) {
                    $.ajax({
                        type: "POST",//方法类型
                        url: "/admin/delPersonInfo" ,//url
                        data: {id:i},
                        success: function (result) {
                            if(result.code == "500"){
                                swal(
                                    '操作提示',
                                    result.msg,
                                    'info'
                                )
                            }else if(result.code == "200"){
                                swal(
                                    '操作提示',
                                    '已删除成功',
                                    'success'
                                )
                                setTimeout(function (){
                                    window.location.reload();
                                }, 1500);
                            }else if(result.code == "100"){
                                Snackbar.show({
                                    text: "您已掉线！",
                                    pos: 'top-center'
                                });
                                setTimeout(function (){
                                    window.location.href="/admin/login";
                                }, 1500);
                            }
                        },
                        error : function() {
                            Snackbar.show({
                                text: '请稍后再试',
                                pos: 'top-center'
                            });
                        }
                    });
                }
            })
        }

        var jt = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                                                 stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                                                 class="feather feather-chevron-down">
                                                <polyline points="6 9 12 15 18 9"></polyline>
                                            </svg> `;
        function formatterTime(time, fmt) {
            if(!time){
                return '';
            }
            if(typeof(time) == "object" || typeof(time) == "OBJECT") {
                var z = {
                    M: time.getMonth() + 1,
                    d: time.getDate(),
                    h: time.getHours(),
                    m: time.getMinutes(),
                    s: time.getSeconds()
                };
                fmt = fmt.replace(/(M+|d+|h+|m+|s+)/g, function(v) {
                    return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2);
                });
                return fmt.replace(/(y+)/g, function(v) {
                    return time.getFullYear().toString().slice(-v.length);
                });
            }else if(typeof(time) == "number"){
                var TIME = new Date( time) ;
                var z = {
                    M: TIME.getMonth() + 1,
                    d: TIME.getDate(),
                    h: TIME.getHours(),
                    m: TIME.getMinutes(),
                    s: TIME.getSeconds()
                };
                fmt = fmt.replace(/(M+|d+|h+|m+|s+)/g, function(v) {
                    return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2);
                });
                return fmt.replace(/(y+)/g, function(v) {
                    return TIME.getFullYear().toString().slice(-v.length);
                });
            }
            else return time;
        }
    </script>
</body>

</html>